from django.shortcuts import render,redirect
from pddShop.settings import AUTH_LIST

class Auth(object):
    def __init__(self,get_response):
        self.get_response= get_response
    def __call__(self,request, *args, **kwargs):
        print(request.path)
        if request.path in AUTH_LIST:
            if not request.session.get('user'):
                return redirect('/user/login')
        return self.get_response(request, *args, **kwargs)

